<template>
    <div class="task-item1">
        <ul>
            <li v-for="item in dataarr">
                <div class="item">
                    <div class="item1" @click="detail(item.system_order_no)">
                        <div class="left">
                            <h1 class="font-normal font-color-normal">订单编号：{{item.system_order_no}}</h1>
                        </div>
                        <div class="right">
                            <span class="more"></span>
                        </div>
                    </div>
                    <div class="text">
                        <h1 class="font-small font-color-normal">
                            <span class="quan-span">取</span>{{item.shop_info.address}}
                            <span class="font-color-shallow right-name">{{item.shop_info.name}}</span>
                        </h1>
                        <h1 class="font-normal font-color-normal"><span class="quan-span red">送</span>{{item.receiver_address}}</h1>
                    </div>
                    <div class="btn-center">
                        <x-button class="btn-blue" @click.native="qucan(item.system_order_no,item.id)">取餐</x-button>
                    </div>
                </div>
            </li>
        </ul>
        
    </div>
</template>

<script>
import { Group, Cell,XButton } from 'vux'
export default {
    props:{
        dataarr:{
            type:Array,
            default:[]
        }
    },
    components: {
        Group,
        Cell,
        XButton
    },
    data(){
        return{

        }
    },
    mounted(){
        //this.initdata()
    },
    methods:{
        detail(id){
            this.$router.push('/detail/'+id)
        },
        qucan(orderno,orderid){
            let token = localStorage.getItem("access_token");
            let params = {"access_token": token,"order_no" : orderno,"order_id" : orderid}
            this.ajaxplugin("/Deliver/get_good",params,(res) => {
                this.$emit('qucan')
            })
        },
    }
}
</script>

<style lang="stylus" scoped>
.task-item1
    .item
        background #ffffff
        margin-bottom 10px
        .item1
            padding 15px 10px
        .text
            h1
                line-height: 35px
                padding: 5px 10px
                border-bottom: 1px solid #eee
                &.no-line
                    border-bottom none
                .right-name
                    float right
                .quan-span 
                    padding: 5px 7px
                    background: #0093f9
                    color: #fff
                    border-radius: 50%
                    margin-right: 5px
                    font-size 12px
                    &.red
                        background #f94c00
</style>